package com.sgb.kjwl.view.ui.adapter.material;

import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.BossEntity;

import java.util.List;

/**
 * 作者:张磊
 * 日期:2021/1/8 0008
 * 说明:商品1.3.6 首页推荐item
 */
public class RecommendAdapter extends BaseQuickAdapter<BossEntity, BaseViewHolder> {


    public RecommendAdapter(List<BossEntity> beans) {
        super(R.layout.recommend_item, beans);
    }

    @Override
    protected void convert(BaseViewHolder helper, final BossEntity item) {
        LinearLayout ll_bg = helper.getView(R.id.ll_bg);
        int pos = helper.getAdapterPosition();
//        LinearLayout.LayoutParams lp1 = (LinearLayout.LayoutParams) ll_bg.getLayoutParams();
//        lp1.setMargins(0, 0, pos % 2 == 0 ? (int) UiUtil.px2dp(5) : 0, (int) UiUtil.px2dp(5));
//        ll_bg.setLayoutParams(lp1);
        helper.setText(R.id.tv_name,item.getName()).setText(R.id.tv_mainBusiness,"主营："+ item.getMainBusiness());
    }
}